<div class="dataTable_wrapper table-responsive">
	<table class="table table-striped table-bordered table-hover" id="dataTables-example">
		<thead>
			<tr>
				<?php
					$titles = array();
					$functions = array();
					$n = 0;
					foreach($head as $k=>$v){
						$titles[] = $k;
						$functions[] = $v[1];
						$n++;
						?>
						<th>{$v[0]}</th>
						<?php
					}
					if($needop){
				?>
				<th>操作</th>
				<?php } ?>
			</tr>
		</thead>
		<tbody>
			<?php
				foreach($body as $k=>$v){
					$trclass = '';
					if($k%2==0){
						$trclass = 'odd';
					}else{
						$trclass = 'even';
					}
					?>
						<tr class="{$trclass}">
					<?php
						for($i = 0; $i<$n; $i++){
						?>
							<td><?php echo $functions[$i]($v[$titles[$i]]); ?></td>
						<?php
						}
					?>
					<?php
						if($needop){
							$neededit = C('OP_TYPE.OP_EDIT')&$needop;
							$needdelete = C('OP_TYPE.OP_DELETE')&$needop;
							$needreset = C('OP_TYPE.OP_RESET')&$needop;
							$needdefine = C('OP_TYPE.OP_DEFINE_RULE')&$needop;
					?>
						<td>
							<?php
								if($neededit != 0){
							?>
							<button class="btn btn-info btn-edit" type="button">
								<span class="glyphicon glyphicon-erase" aria-hidden="true"></span> 编辑
							</button>
							<?php
						}
						if($needdelete != 0){
							 ?>
							<button class="btn btn-danger btn-delete" type="button">
								<span class="glyphicon glyphicon-floppy-remove" aria-hidden="true"></span> 删除
							</button>
							<?php
						}
						if($needdefine != 0){
							?>
							<button class="btn btn-warning btn-rule" type="button">
								<span class="glyphicon glyphicon-usd" aria-hidden="true"></span> 收费规则
							</button>
							<?php
						}
						if($needreset != 0){
							?>
							<button class="btn btn-warning btn-reset" type="button">
								<span class="glyphicon glyphicon-cog" aria-hidden="true"></span> 重置密码
							</button>
						</td>
						<?php }} ?>
						</tr>
					<?php
				}
			?>
		</tbody>
	</table>
</div>
